/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.zhaojiu.service.dto;

import lombok.Data;
import me.zhengjie.base.BaseDTO;

import java.sql.Timestamp;
import java.io.Serializable;
import java.util.Objects;

/**
* @website https://el-admin.vip
* @description /
* @author Jiayin Wei
* @date 2021-12-09
**/
@Data
public class AttendanceDto extends BaseDTO implements Serializable {

    /** 考勤ID */
    private Long attendanceId;

    /** 名称 */
    private String name;

    /** 教师ID */
    private Long teacherId;

    private TeacherSmallDto teacher;

    /** 班级ID */
    private Long classId;

    private ClassSmallDto classModel;

    private Long courseId;

    private CourseSmallDto course;

    /** 时间 */
    private Timestamp date;

    /** 状态 */
    private Boolean enabled;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AttendanceDto attDto = (AttendanceDto) o;
        return Objects.equals(attendanceId, attDto.attendanceId) &&
                Objects.equals(name, attDto.name) &&
                Objects.equals(teacherId, attDto.teacherId) &&
                Objects.equals(classId, attDto.classId) &&
                Objects.equals(date, attDto.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(attendanceId, name, teacherId, classId, date);
    }
}
